// 模拟双击
let currentDate;
let timer;
const threshold = 200;
export const isDoubleClick = () => {
    if (timer) clearTimeout(timer);

    timer = setTimeout(() => {
        currentDate = null;
    }, threshold);

    if (!currentDate) {
        currentDate = new Date();
        return false;
    }
    return +new Date() - +currentDate < threshold;
};
